#!/usr/local/bin/python3
# -*- coding: UTF-8 -*-
"""
@author:apple
@file:random_module.py
@time:2021/08/18
"""
import random


def test01():
    ...
    print(random.random())
    # [a, b]
    print(random.randint(1, 10))
    print(random.choice(['1', 'a', 'b']))
    # sample 采样
    print(random.sample(['1', 'a', 'b'], 2))

    print(random.shuffle([1,2,3,4]))

def create_code(count=4):
    ...
    all_container = [chr(i) for i in range(65, 91)]
    for i in range(0,10):
        all_container.append(str(i))
    selects = []
    for i in range(count):
        selects.append(random.choice(all_container))
    return "".join(selects)


if __name__ == '__main__':
    pass
    test01()
    print(create_code(6))